import request from "@/utils/request";

// 查询题目列表
export function listJuanQuestion(query) {
  return request({
    url: "/juan/juanQuestion/list",
    method: "get",
    params: query,
  });
}

// 查询题目详细
export function getJuanQuestion(questionId) {
  return request({
    url: "/juan/juanQuestion/" + questionId,
    method: "get",
  });
}

// 新增题目
export function addJuanQuestion(data) {
  return request({
    url: "/juan/juanQuestion",
    method: "post",
    data: data,
  });
}

// 修改题目
export function updateJuanQuestion(data) {
  return request({
    url: "/juan/juanQuestion",
    method: "put",
    data: data,
  });
}

// 删除题目
export function delJuanQuestion(questionId) {
  return request({
    url: "/juan/juanQuestion/" + questionId,
    method: "delete",
  });
}

// 题目查询接口
export function getQuestionList(query) {
  return request({
    url: "/juan/juanQuestion/getQuestionList",
    method: "get",
    params: query,
  });
}

// 题目查询接口
export function getQuestionListNew(query) {
  return request({
    url: "/juan/juanQuestion/getQuestionListNew",
    method: "get",
    params: query,
  });
}

// 根据ids查询题目列表
export function getQuestionByIds(query) {
  return request({
    url: "/juan/juanQuestion/getQuestionByIds",
    method: "get",
    params: query,
  });
}

// 根据试卷历史id查询题目列表
export function getBakeupQuestionById(id) {
  return request({
    url: "/juan/juanPaperBakeup/queryQuestionsById/" + id,
    method: "get",
  });
}

// 根据课程id查询章节树
export function getChapterTreeByQuestion(query) {
  return request({
    url: "/juan/juanQuestion/getChapterTreeByQuestion",
    method: "get",
    params: query,
  });
}

// 根据课程id查询知识点树
export function getKnowledgeTreeByQuestion(query) {
  return request({
    url: "/juan/juanQuestion/getKnowledgeTreeByQuestion",
    method: "get",
    params: query,
  });
}

// 根据课程id查询知识点树
export function getKnowledgeTreeByQuestion1(query) {
  return request({
    url: "/juan/juanQuestion/getKnowledgeTreeByQuestion1",
    method: "get",
    params: query,
  });
}
